<!--!
This file is a part of MediaDrop (http://www.mediadrop.net),
Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors.
For the exact contribution history, see the git revision log.
The source code contained in this file is licensed under the GPLv3 or
(at your option) any later version.
See LICENSE.txt in the main project directory, for more information.
-->

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:fb="http://www.facebook.com/2008/fbml"
      py:strip="">

<py:def function="facebook_like(url=None, show_faces=False, width=313)">
    <div class="fb-like"
        data-href="${url}"
        data-send="false"
        data-width="${width}"
        data-show-faces="${str(show_faces).lower()}">
    </div>
</py:def>

<py:def function="facebook_comment(media=None, width=570)"
    py:with="use_xid = media.meta.get('facebook-comment-xid')">
    <py:choose>
        <py:when test="use_xid">
	        <fb:comments xid="${media.meta['facebook-comment-xid']}" 
	            numposts="10" simple="1" width="${width}" publish_feed="true">
            </fb:comments>
        </py:when>
        <py:otherwise>
            <div class="fb-comments" 
                data-href="${h.url_for_media(media, qualified=True)}" 
                data-num-posts="10" 
                data-width="${width}">
            </div>
        </py:otherwise>
    </py:choose>
</py:def>

</html>
